{% load url from future%}{% load i18n apps_tags property_admin_tags visitevent_calendar_tags thumbnail %}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE|default:"en-us" }}" xml:lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
   <head>
        <title>{% block title %}{% endblock %}</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <!-- Bootstrap -->
        <link href="{{ MEDIA_REAL_ESTATE }}bootstrap2/css/bootstrap.css" rel="stylesheet" media="screen">
        <link href="{{ MEDIA_REAL_ESTATE }}bootstrap2/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
        <link href="{{ MEDIA_REAL_ESTATE }}admin/css/icons-custom.css" rel="stylesheet" media="screen">
        <link href="{{ MEDIA_REAL_ESTATE }}admin/css/custom-bootstrap.css" rel="stylesheet" media="screen">
        <link href="{{ MEDIA_REAL_ESTATE }}admin/css/widget.css" rel="stylesheet" media="screen">
        <script src="{{ MEDIA_REAL_ESTATE }}bootstrap2/js/jquery.js"></script>
        <script src="{{ MEDIA_REAL_ESTATE }}bootstrap2/js/bootstrap.min.js"></script>
        {% block extrastyle %}{% endblock %}
        {% block extrahead %}{% endblock %}
        {% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
    </head>
<body>
    {% get_apps_menu menu as apps_menu_list %}
    {% get_apps_menu settings as apps_settings_list %}

    <div class="clearfix">
        <header>
            <div class="navbar navbar-fixed-top">
                <div class="navbar-inner">
                    <div class="real_apps">
                      <a title="{% trans 'Menu' %}" data-target=".appsbar" data-toggle="collapse" class="btn btn-navbar btn-left btn-menu">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                      </a>
                      <a href="{% url 'admin:index' %}" class="brand hidden-phone">{{ SITE_TITLE }}</a>
                      {% if user.is_authenticated %}
                          <div class="hidden-desktop nav-buttons">
                            <ul class="nav pull-right">
                              <li class="dropdown">
                                <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-user"></i></a>
                                <ul class="dropdown-menu">
                                    <li>
                                        {% url 'admin:password_change' as password_change_url %}
                                        {% if password_change_url %}
                                            <a href="{{ password_change_url }}">
                                        {% else %}
                                            <a href="{{ root_path }}password_change/">
                                        {% endif %}
                                        {% trans 'Change password' %}</a> 
                                    </li>
                                    <li>
                                        <a href="{% url 'admin:auth_user_change' user.id %}" > <i class="icon-edit"></i> Edit </a>
                                    </li>
                                    <li class="divider"></li>
                                    <li>
                                        {% url 'admin:logout' as logout_url %}
                                        {% if logout_url %}
                                            <a href="{{ logout_url }}">
                                        {% else %}
                                            <a href="{{ root_path }}logout/">
                                        {% endif %}
                                        <i class="icon-off"></i>
                                        {% trans 'Log out' %}</a>
                                    </li>
                                </ul>
                              </li>
                            </ul>
                            {% if apps_settings_list %}
                            <ul class="nav pull-right">
                              <li class="dropdown">
                                <a data-toggle="dropdown" class="btn dropdown-toggle" href="#"><i class="icon-wrench"></i> </a>
                                <ul class="dropdown-menu">
                                  {% for app in apps_settings_list %} 
                                        {% for model in app.models %}
                                            {% if model.perms.change %}
                                            <li><a href="{{ model.admin_url }}">
                                               {% if model.module_name == 'user' %}
                                                    <i class="icon-user"></i>
                                                {% endif %}
                                                {% if model.module_name == 'group' %}
                                                    <i class="icon-hdd"></i>
                                                    <i class="icon-group"></i>
                                                {% endif %}
                                                {% if model.module_name == 'termvisit' %}
                                                    <i class="icon-book"></i>
                                                {% endif %}
                                                {% if model.module_name == 'site' %}
                                                    <i class="icon-briefcase"></i>
                                                {% endif %}
                                                {{ model.name }}
                                            </a></li>
                                            {% endif %}
                                        {% endfor %}
                                  {% endfor %}
                                </ul>
                              </li>
                            </ul>
                            {% endif %}
                          </div>
                      {% endif %}
                      <div class="nav-collapse collapse navbar-responsive-collapse">
                        {% if user.is_authenticated and apps_settings_list %}
                        <ul class="nav pull-right">
                          <li class="dropdown">
                            <a data-toggle="dropdown" class="dropdown-toggle" href="#"><i class="icon-wrench"></i> {% trans "Settings" %} </a>
                            <ul class="dropdown-menu">
                              {% for app in apps_settings_list %} 
                                    {% for model in app.models %}
                                        {% if model.perms.change %}
                                            <li><a href="{{ model.admin_url }}">
                                                {% if model.module_name == 'user' %}
                                                    <i class="icon-user"></i>
                                                {% endif %}
                                                {% if model.module_name == 'group' %}
                                                    <i class="icon-group"></i>
                                                {% endif %}
                                                {% if model.module_name == 'termvisit' %}
                                                    <i class="icon-book"></i>
                                                {% endif %}
                                                {% if model.module_name == 'site' %}
                                                    <i class="icon-briefcase"></i>
                                                {% endif %}
                                                {{ model.name }}
                                            </a></li>
                                        {% endif %}
                                    {% endfor %}
                              {% endfor %}
                            </ul>
                          </li>
                        </ul>
                        <div class="btn-group pull-right">
                            <a class="btn btn-primary" href="{% url 'admin:auth_user_change' user.id %}"><i class="icon-user icon-white"></i> {% filter force_escape %}{% firstof user.first_name user.username %}{% endfilter %} </a>
                            <a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <li>
                                    {% url 'admin:password_change' as password_change_url %}
                                    {% if password_change_url %}
                                        <a href="{{ password_change_url }}">
                                    {% else %}
                                        <a href="{{ root_path }}password_change/">
                                    {% endif %}
                                    {% trans 'Change password' %}</a> 
                                </li>
                                <li>
                                    <a href="{% url 'admin:auth_user_change' user.id %}" > <i class="icon-edit"></i> Edit </a>
                                </li>
                                <li class="divider"></li>
                                <li>
                                    {% url 'admin:logout' as logout_url %}
                                    {% if logout_url %}
                                        <a href="{{ logout_url }}">
                                    {% else %}
                                        <a href="{{ root_path }}logout/">
                                    {% endif %}
                                    <i class="icon-off"></i>
                                    {% trans 'Log out' %}</a>
                                </li>
                            </ul>
                        </div>
                        {% endif %} <!-- user menu -->
                      </div><!-- /.nav-collapse -->
                    </div>
                </div><!-- /navbar-inner -->
            </div>
        </header>
        <div class="real_content row-fluid">
            {% if user.is_authenticated %}
                {% if apps_menu_list %}
                <div class="row-fluid span2  real_apps">
                        <div class="nav-collapse collapse appsbar">
                            <ul class="nav nav-list">
                                <li class="nav-header">{% trans 'Apps' %}</li>
                                <li class="divider"></li>
                                {% for app in apps_menu_list %} 
                                    {% for model in app.models %}
                                        {% if model.perms.change %}
                                            <li scope="row"><a href="{{ model.admin_url }}">{{ model.name }}</a></li>
                                        {% endif %}
                                    {% endfor %}
                                {% endfor %}
                            </ul>
                        </div>
                </div>
                {% else %}
                    <p>{% trans "You don't have permission to edit anything." %}</p>
                {% endif %}
            {% endif %}
            <div class="row-fluid {% if user.is_authenticated %} span7 well {% endif %}" >
            <!--Body content-->
                <div class="row-fluid breadcrumbs">
                    {% if not is_popup %}
                        {% block breadcrumbs %}{% endblock %}
                    {% endif %}
                </div>
                <div class="row-fluid apps_contents">
                            
                        <div class="content_title">
                            {% block pretitle %}{% endblock %}
                            {% block content_title %}{% endblock %}
                        </div>
                        <div class="content">
                            {% block content %}
                                {% block object-tools %}{% endblock %}
                                {{ content }}
                            {% endblock %}
                        </div>
                </div>
            </div>
            {% if user.is_authenticated %}
                <div class="row-fluid span3 real_apps">

                    <div class="nav-collapse collapse sidebar">
                        {% get_property_will_expired 10 as property_will_expired %}
                        {% if property_will_expired %}
                        <div id="content-related" class="widget">
                            <div class="widget-header">
                                <i class="icon-bullhorn"></i><h3> Imóveis que espiram nos últimos 5 dias </h3>
                            </div>
                            <div class="widget-content">
                                <ul class="thumbnails">
                                    {% for property in property_will_expired %}
                                    <li class="span4">
                                        <div class="thumbnail">
                                            {% thumbnail property.get_random_photo  "160x120" crop="center" as img %}
                                                <img width="{{ img.width }}" height="{{ img.height }}" src="{{ img.url }}"/> 
                                            {% endthumbnail %}
                                            {{ property.admin_link }}
                                        </div>
                                    </li>
                                    {% endfor %}
                                </ul>
                            </div>
                        </div>
                        {% endif %}
                        {% get_calendarvisitevent admin no_show_events as calendar %}                        
                        {% if calendar %}
                        <div id="index-calendar" class="widget">
                            <div class="widget-header">
                                <i class="icon-calendar"></i> <h3 style=""> {% trans 'Visit calendar' %} </h3>
                            </div>
                            <div class="widget-content">
                                {{ calendar }}
                            </div>
                        </div>
                        {% endif %}                        
                        
                        {% block sidebar %}{% endblock %}
                    </div>
                </div>
            {% endif %}
            <div class="row-fluid">
                <div class="span12" >
                    <p>
                        <!--address>
                        <strong>Twitter, Inc.</strong><br />
                        795 Folsom Ave, Suite 600<br />
                        San Francisco, CA 94107<br />
                        <abbr title="Phone">P:</abbr> (123) 456-7890
                        </address-->
                    </p>
                </div>
            </div>
        </div>
    </div>
</body>
</html>